﻿// See https://aka.ms/new-console-template for more information


using GCC.Container.Abstracts;
using GCC.Container.LogProviders;

namespace asd
{
    public class zxc
    {
        public static async Task Main()
        {
            var
            _logger = GCCLoggerProvider.GetInstance(new LogOptions() { EnableConsole = false }).CreateLogger<zxc>();
            var cancel = new CancellationTokenSource();

            //{
            //    using var zxc = GCCLoggerProvider.Instance.CreateScopeLogger<zxc>("qweqweqweqwe");
            //    zxc.Critical("asdadasd");
            //}


            var b = 0;
            _ = Task.Run(() =>
              {


                  for (int i = 0; i < 10; i++)
                  {
                      _ = Task.Run(() =>
                      {

                          while (!cancel.Token.IsCancellationRequested)
                          {
                              _logger.Information("qweqweqeqweqqweqweqeqweqqweqweqeqweqqweqweqeqweqqweqweqeqweqqweqweqeqweqqweqweqeqweq");
                              b++;
                          }

                      }, cancel.Token);
                  }

              });


            await Task.Delay(3000);
            cancel.Cancel();
            Console.WriteLine(b);

            _ = Console.ReadLine();

        }
    }
}